package com.sxy;

import com.sxy.dao.BookDao;
import com.sxy.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 宋鑫宇
 * @version 1.0
 */
public class App {
    public static void main(String[] args) {
        //获取ioc容器
        ApplicationContext c = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookDao bookDao = (BookDao) c.getBean("bookDao");
        bookDao.save();
        BookService bookService = c.getBean(BookService.class);
        bookService.save();
    }
}
